<%@include file="index.jsp"%>
<%@ page import="com.verbetia.musictrends.persistence.hsqldb.MusicEntity" %>
<%@ page import="com.verbetia.musictrends.persistence.hsqldb.UserEntity" %>
<jsp:useBean id="home" class="com.verbetia.musictrends.web.music.ViewMusic" />


<% UserEntity prof = (UserEntity)session.getAttribute("User"); %>

 <div id="content">           
        <div id="page"><div id="page-contents">

<h1><%= session.getAttribute("username").toString () %> listened music:</h1>
<a href="rss.jsp?u=<%= prof.getUserid() %>">RSS <img src="./img/feed-icon-14x14.png" alt="my feed"/></a>
<br>
<table>

<% java.util.ArrayList a = home.processSongs( session.getAttribute("User") ); 

  if (a!=null)
   for (int i=0; i!=a.size(); i++)
   { 
		MusicEntity m = (MusicEntity)a.get(i);   
   %>
	<tr>
	 <td><h1><%= m.getTitle() %><h1></td>
	 <td><h3><%= m.getArtist() %></h3></td>
	 <td><h3><%= m.getAlbum() %></h3></td>
	 <td><h3><%= m.getDateFormated("HH:mm:ss MM/dd/yy") %></h3></td>
	 <td><a href="<%= m.getAmazonid() %>"><img src="<%= m.getAmazonid() %>" alt="<%= m.getAlbum() %>" height="60" width="60" /></a></td>	
<%	 if (session.getAttribute("username")!=null) { %>
 	 <td><a href="delete?iid=<%= m.getId() %>"><img src="./img/delete.png" alt="del" /></a></td>
	<% } %>

	</tr>

 <%  }%>
 </table>
 
</div></div></div>
  

